package org.fun.kafkademo.model;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 批量处理结果
 */
public class BatchProcessResult {
    
    private int totalProcessed;
    private int successCount;
    private int failureCount;
    private List<String> errors;
    private LocalDateTime startTime;
    private LocalDateTime endTime;
    private long processingTimeMs;
    
    public BatchProcessResult() {}
    
    public BatchProcessResult(int totalProcessed, int successCount, int failureCount, 
                             List<String> errors, LocalDateTime startTime, LocalDateTime endTime) {
        this.totalProcessed = totalProcessed;
        this.successCount = successCount;
        this.failureCount = failureCount;
        this.errors = errors;
        this.startTime = startTime;
        this.endTime = endTime;
        this.processingTimeMs = java.time.Duration.between(startTime, endTime).toMillis();
    }
    
    // Getters and Setters
    public int getTotalProcessed() {
        return totalProcessed;
    }
    
    public void setTotalProcessed(int totalProcessed) {
        this.totalProcessed = totalProcessed;
    }
    
    public int getSuccessCount() {
        return successCount;
    }
    
    public void setSuccessCount(int successCount) {
        this.successCount = successCount;
    }
    
    public int getFailureCount() {
        return failureCount;
    }
    
    public void setFailureCount(int failureCount) {
        this.failureCount = failureCount;
    }
    
    public List<String> getErrors() {
        return errors;
    }
    
    public void setErrors(List<String> errors) {
        this.errors = errors;
    }
    
    public LocalDateTime getStartTime() {
        return startTime;
    }
    
    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }
    
    public LocalDateTime getEndTime() {
        return endTime;
    }
    
    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }
    
    public long getProcessingTimeMs() {
        return processingTimeMs;
    }
    
    public void setProcessingTimeMs(long processingTimeMs) {
        this.processingTimeMs = processingTimeMs;
    }
    
    @Override
    public String toString() {
        return "BatchProcessResult{" +
               "totalProcessed=" + totalProcessed +
               ", successCount=" + successCount +
               ", failureCount=" + failureCount +
               ", errors=" + errors +
               ", startTime=" + startTime +
               ", endTime=" + endTime +
               ", processingTimeMs=" + processingTimeMs +
               '}';
    }
}
